<?php
	include_once("adb.php");
	
	
	class birth extends adb{
		function birth(){
			adb::adb();
		}
		/**
		*query all births in the table and store the dataset in $this->result	
		*@return if successful true else false
		*/
		
		function get_all_birth(){
		
			$query="select * from birth";
			if(!$this->query($query)){
				return false;
			}
			return $this->query($query);
		}
			
			  
		  
		function add_birth($name,$gender,$place_of_birth,$date_of_birth){
			//write the SQL query and call $this->query()
			$query="INSERT INTO  birth(name, gender, place_of_birth, date_of_birth) VALUES
	('$name','$gender','$place_of_birth','$date_of_birth')";
			return $this->query($query);
		}
		
		
		/**
		*updates the record identified by id 
		*/
	 function update_birth($birth_id,$name,$gender,$date_of_birth,$place_of_birth){
		$query ="UPDATE birth SET date_of_birth= '$date_of_birth', gender='$gender', name = '$name',place_of_birth= '$place_of_birth'  WHERE birth_id =$birth_id";
	
		return $this->query($query);
		}
	
		
		function get_birth($id){
		$query = "select * from birth where birth_id = $id";
		if(!$this->query($query)){
			return false;
			}
		return $this->query($query);
		}
		
	
	}
	
?>